# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kleopatra
pkgver=24.08.2
pkgrel=0
arch="all !armhf !s390x"
url="https://www.kde.org/applications/utilities/kleopatra/"
pkgdesc="Certificate Manager and Unified Crypto GUI"
license="GPL-2.0-or-later AND GFDL-1.2-only"
depends="
	gnupg
	pinentry-qt
	"
makedepends="
	boost-dev
	extra-cmake-modules
	gpgme-dev
	kcmutils-dev
	kcodecs-dev
	kconfig-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	kdoctools-dev
	kdoctools-dev
	ki18n-dev
	kiconthemes-dev
	kitemmodels-dev
	kmbox-dev
	kmime-dev
	kstatusnotifieritem-dev
	kwidgetsaddons-dev
	kwindowsystem-dev
	kxmlgui-dev
	libassuan-dev
	libkleo-dev
	mimetreeparser-dev
	qgpgme
	qt6-qtbase-dev
	samurai
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/pim/kleopatra.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kleopatra-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	dbus-run-session -- xvfb-run -a ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
6b9b72be12aa707702183cd163a08cfcdb99787667d045e30b77d97d0230d590068fbc0ccf35fbf0f2fb669b0f67a3016161a7a03b3cefe14fe6b8956efdcf4b  kleopatra-24.08.2.tar.xz
"
